import random
import collections
d = dict()
s = "abcdefghijklmnopqrstuvwxyz"
for i in range(100):
    l1 = random.choices(s,k=2)
    l2 = l1[0] + l1[1]
    if d.get(l2) == None:
        d[l2] = 1
    else:
        d[l2] += 1
d2 = collections.OrderedDict(sorted(d.items(), key=lambda t: t[1],reverse=1))
for i in d2:
    print("str:{}, times:{}".format(i,d2[i]))


# 做的不错